import React  from 'react';
import { NavView, get_mod, NavListSub } from 'sui';
import FlipOutlined from '@material-ui/icons/FlipOutlined';
import { TechView } from './tech';
import { get_title } from './cmd';

const model = (cfg) => {
    const fix = [
        {uid: "tech.angle", view: TechView, value: get_title("angle")},
        {uid: "tech.short", view: TechView, value: get_title("short")},
    ];

    return get_mod(cfg, fix, "tech");
};

const Tech = ({ mod, setEvent, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} setEvent={setEvent} sideopen={sideopen} name="tech"/>;

const NavTech = (props) => <NavListSub icon={<FlipOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavTech, Tech};
